<template>
    <div>

   <h1>home组件-----------{{$store.state.msg}}</h1>
   <h2 v-if='$store.state.homeList.info'>获取homeList的数据：   {{$store.state.homeList.info.text}}</h2>
     <button @click="handlerClick">点击实现vuex开了流程</button>

     <button @click="getData">点击发送请求</button>
     <button  @click="addCount">点击增加count的值 ++</button>


      <h2>{{$store.state.count}}</h2>
     <hr>
     <h2>使用 getters 计算属性 ：{{$store.getters.totalCount}}</h2>

    </div>
</template>

<script>
export default {
    data() {
        return {

        };
    },
    created() {

    },
    mounted() {

    },
    methods: {
        handlerClick() {
            this.$store.dispatch('disHome')

        },
        getData() {
            // axios.get()
             this.$store.dispatch('disGetData')

        },
        addCount() {
            this.$store.dispatch('addCount',1000)
        }

    }
};
</script>

<style scoped   lang='css'>

</style>
